package la.iok.hzsvn.lewin.movie.model;

import java.util.Arrays;
import java.util.Objects;

public class MovieParam {
    /**
     * 名称
     */
    private String name;
    /**
     * 作者
     */
    private String author;
    /**
     * 标签数组
     */
    private String[] tag;
    /**
     * 简介
     */
    private String brief;
    /**
     * 最少玩家数量
     */
    private Integer minPlayers;
    /**
     * 最大玩家数量
     */
    private Integer maxPlayers;
    /**
     * 持续时长
     */
    private float duration;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String[] getTag() {
        return tag;
    }

    public void setTag(String[] tag) {
        this.tag = tag;
    }

    public String getBrief() {
        return brief;
    }

    public void setBrief(String brief) {
        this.brief = brief;
    }

    public Integer getMinPlayers() {
        return minPlayers;
    }

    public void setMinPlayers(Integer minPlayers) {
        this.minPlayers = minPlayers;
    }

    public Integer getMaxPlayers() {
        return maxPlayers;
    }

    public void setMaxPlayers(Integer maxPlayers) {
        this.maxPlayers = maxPlayers;
    }

    public float getDuration() {
        return duration;
    }

    public void setDuration(float duration) {
        this.duration = duration;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MovieParam param = (MovieParam) o;
        return Float.compare(param.duration, duration) == 0 && Objects.equals(name, param.name) && Objects.equals(author, param.author) && Arrays.equals(tag, param.tag) && Objects.equals(brief, param.brief) && Objects.equals(minPlayers, param.minPlayers) && Objects.equals(maxPlayers, param.maxPlayers);
    }

    @Override
    public int hashCode() {
        int result = Objects.hash(name, author, brief, minPlayers, maxPlayers, duration);
        result = 31 * result + Arrays.hashCode(tag);
        return result;
    }
}
